package com.ysd.lis.controller.eq;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.eq.EqMaintainOrder;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.request.eq.EqMaintainDto;
import com.ysd.lis.request.eq.EqRepairParam;
import com.ysd.lis.service.eq.EqMaintainOrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 设备管理-设备类型 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-07-31
 */
@RestController
@RequestMapping("/api/eq/eqMaintainOrder")
public class EqMaintainOrderController extends BaseController {

    @Autowired
    EqMaintainOrderService eqMaintainOrderService;
    @ApiOperation("分页查询")
    @GetMapping("/findMaintainOrderPageList")
    public Result findMaintainOrderPageList(CommonPageDto pageParam){
        return eqMaintainOrderService.findMaintainOrderPageList(pageParam);
    }

    @ApiOperation("添加")
    @PostMapping("/addMaintainOrder")
    public Result addMaintainOrder(@RequestBody EqMaintainOrder eqMaintainOrder) {
        return eqMaintainOrderService.addMaintainOrder(eqMaintainOrder);
    }
    @ApiOperation("编辑")
    @PostMapping("/updateMaintainOrder")
    public Result updateMaintainOrder(@RequestBody EqMaintainOrder eqMaintainOrder) {
        return eqMaintainOrderService.updateMaintainOrder(eqMaintainOrder);
    }

    @ApiOperation("根据ID查")
    @GetMapping("/findEqMaintainOrderById")
    public Result findEqMaintainOrderById( EqMaintainOrder eqMaintainOrder) {
        return eqMaintainOrderService.findEqMaintainOrderById(eqMaintainOrder);
    }

    @ApiOperation("添加")
    @PostMapping("/verifyMaintainOrder")
    public Result verifyMaintainOrder(@RequestBody EqMaintainDto dto) {
        return eqMaintainOrderService.verifyMaintainOrder(dto);
    }
    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteMaintainOrderList")
    public Result batchDeleteMaintainOrderList(@RequestBody EqMaintainDto dto){
        return  eqMaintainOrderService.batchDeleteMaintainOrderList(dto);
    }

    @ApiOperation("设备保养分析")
    @GetMapping("/getMaintainTjfxByEqType")
    public Result getMaintainTjfxByEqType(EqRepairParam param){
        return eqMaintainOrderService.getMaintainTjfxByEqType(param);
    }
}
